package com.qf.hmadmin.crueManagement.mark.controller;


import com.github.pagehelper.PageInfo;
import com.qf.hmadmin.crueManagement.mark.param.MarkPageParam;
import com.qf.hmadmin.crueManagement.mark.service.MarkService;
import com.qf.hmadmin.crueManagement.mark.vo.AddMarkActive;
import com.qf.hmadmin.crueManagement.mark.vo.MarkVO;
import com.qf.utils.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Mark)表控制层
 *
 * @author makejava
 * @since 2024-10-05 23:01:21
 */
@RestController
@RequestMapping("/crueManagement/mark")
public class MarkController {
    /**
     * 服务对象
     */
    @Resource
    private MarkService markService;

    @GetMapping("/selectAllMark")
public R  selectAllMark(MarkPageParam markPageParam){
        System.out.println("markPageParam"+markPageParam);

    PageInfo<MarkVO> markVOPageInfo = markService.pageMark(markPageParam);

    return  R.ok(markVOPageInfo) ;
}

@GetMapping("/deleteMark")
public  R  deleteMark(Integer id){

       Boolean isOk =    markService.deleteMark(id);
        return  R.ok(isOk) ;
}

@GetMapping("/deleteMarkBatch")
    public  R  deleteMarkBatch(@RequestParam List<Integer> ids){

       Boolean isOk =   markService.deleteMarkBatch(ids);

        return  R.ok(isOk);
    }

    @PostMapping("/addMarkActive")
    public  R  addMarkActive(@RequestBody AddMarkActive addMarkActive){
        System.out.println("addMarkActive"+addMarkActive);

       Boolean isOk =  markService.addMarkActive(addMarkActive);

        return  R.ok(isOk);
    }

}

